package com.petAdoption.manager.service.impl;

import com.petAdoption.manager.entity.Pet;
import com.petAdoption.manager.mapper.PetMapper;
import com.petAdoption.manager.service.IPetService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.petAdoption.manager.vo.PetVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 王倩茹
 * @since 2023-08-28
 */
@Service
public class PetServiceImpl extends ServiceImpl<PetMapper, Pet> implements IPetService {

    @Resource
    private PetMapper petMapper;


    @Override
    public List<PetVO> findByName(String petName) {
        return petMapper.findByName(petName);
    }

    @Override
    public int deletePet(Integer pid) {
        return petMapper.deleteById(pid);
    }

    @Override
    public List<PetVO> findByNameAll(String petName) {
        return  petMapper.findByNameAll(petName);
    }


    @Override
    public int addPet(Pet pet) {
        return petMapper.addPet(pet);
    }

    @Override
    public int updatePet(Pet pet) {
        return petMapper.updatePet(pet);
    }

    @Override
    public List<PetVO> findPetAll() {
        return petMapper.findPetAll();
    }


}
